<template>
  <div>
    <!-- 声明式导航 -->
    <p>
      <router-link to="/home">首页</router-link>
      <router-link to="/category">分类</router-link>
      <router-link to="/car">购物车</router-link>
      <router-link to="/mine">我的</router-link>
    </p>
    <!-- 
      Transition: 组件的名字 会替换掉默认的v
      例如: 如果没有name. 默认的类名都是以 v-开头
      如果设置了name =slide-fade 属性., 则以 slide-fade-开头
     -->
    <Transition name="slide-fade">
      <router-view></router-view>
    </Transition>
  </div>
</template>
<script>
export default {
  data() {
    return {
      msg: 123,
    };
  },
  components: {},
};
</script>
<style scoped>
.slide-fade-enter-active {
  transition: all 0.3s ease-out;
}

.slide-fade-leave-active {
  transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}

.slide-fade-enter-from,
.slide-fade-leave-to {
  transform: translateX(20px);
  opacity: 0;
}
</style>
